﻿<phone:PhoneApplicationPage 
    x:Class="Appology.SugarSync.Explorer.Phone.File"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Converters="clr-namespace:Appology.SugarSync.Explorer.Phone.Converters" xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls" FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    x:Name="Root"
    shell:SystemTray.IsVisible="True">
	<phone:PhoneApplicationPage.Resources>
		<Converters:FileLengthBytesToTextConverter x:Key="FileLengthBytesToTextConverter" />
		<Converters:BooleanToYesNoConverter x:Key="BooleanToYesNoConverter" />
		<Converters:DateTimeOffsetToLocalDateTimeConverter x:Key="DateTimeOffsetToLocalDateTimeConverter" />
	</phone:PhoneApplicationPage.Resources>
	<phone:PhoneApplicationPage.ApplicationBar>
		<shell:ApplicationBar>
			<shell:ApplicationBar.MenuItems>
				<shell:ApplicationBarMenuItem x:Name="RenameFile" Text="rename file" Click="RenameFile_Click"/>
				<shell:ApplicationBarMenuItem x:Name="DeleteFile" Text="delete file" Click="DeleteFile_Click"/>
			</shell:ApplicationBar.MenuItems>
			<shell:ApplicationBarIconButton x:Name="Refresh" IconUri="/icons/appbar.refresh.rest.png" Text="refresh" Click="Refresh_Click"/>
			<shell:ApplicationBarIconButton x:Name="Download" IconUri="/icons/appbar.download.rest.png" Text="download" Click="Download_Click"/>
			<shell:ApplicationBarIconButton x:Name="Share" IconUri="/icons/appbar.share.rest.png" Text="share" Click="Share_Click"/>
			<shell:ApplicationBarIconButton x:Name="Email" IconUri="/icons/appbar.feature.email.rest.png" Text="email" Click="Email_Click" IsEnabled="False"/>
		</shell:ApplicationBar>
	</phone:PhoneApplicationPage.ApplicationBar>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <controls:Pivot Title="SUGARSYNC EXPLORER">
            <controls:PivotItem Header="preview">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <Image Source="icons/Document.png" Height="425" Stretch="None"/>
                    
                    <Grid x:Name="ImageContainer">
                        <Image x:Name="Image" Height="425" Stretch="Uniform"/>
                    </Grid>
                    
                    <Grid x:Name="MediaContainer">
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <MediaElement x:Name="Media" MediaOpened="Media_MediaOpened" MediaEnded="Media_MediaEnded" MediaFailed="Media_MediaFailed"/>
                        <Grid Grid.Row="1" HorizontalAlignment="Center" Width="280">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <ProgressBar x:Name="Position" Grid.ColumnSpan="2"/>
                            <TextBlock x:Name="TimeElapsed" Grid.Row="1" HorizontalAlignment="Left"/>
                            <TextBlock x:Name="TimeRemaining" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right"/>
                        </Grid>
                        <Grid Grid.Row="2" >
                        	<Grid.ColumnDefinitions>
                        		<ColumnDefinition/>
                        		<ColumnDefinition/>
                        		<ColumnDefinition/>
                        	</Grid.ColumnDefinitions>
                        	<RepeatButton x:Name="Rewind" Click="Rewind_Click" IsEnabled="False" BorderBrush="Transparent" Style="{StaticResource TransportRepeatButtonStyle}" d:LayoutOverrides="Width" HorizontalAlignment="Left">
                        		<Image Source="/icons/appbar.transport.rew.rest.png" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="None"/>
                        	</RepeatButton>
                        	<Button x:Name="PlayOrPause" Click="PlayOrPause_Click" IsEnabled="False" BorderBrush="Transparent" Style="{StaticResource TransportButtonStyle}" HorizontalAlignment="Center" Grid.Column="1">
                        		<Grid>
                        			<Image x:Name="PauseImage" Source="/icons/appbar.transport.pause.rest.png" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="None"/>
                        			<Image x:Name="PlayImage" Source="/icons/appbar.transport.play.rest.png" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="None"/>
                        		</Grid>
                        	</Button>
                        	<RepeatButton x:Name="Forward" Click="Forward_Click" IsEnabled="False" BorderBrush="Transparent" Style="{StaticResource TransportRepeatButtonStyle}" HorizontalAlignment="Right" Grid.Column="2">
                        		<Image Source="/icons/appbar.transport.ff.rest.png" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="None"/>
                        	</RepeatButton>
                        </Grid>
                    </Grid>
                    
                    <TextBlock Margin="10" Grid.Row="1" TextWrapping="Wrap" Text="{Binding Name}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                </Grid>
            </controls:PivotItem>
            <controls:PivotItem Header="details">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Column="0" Grid.Row="0" Margin="5" TextWrapping="Wrap" Text="Name:" d:LayoutOverrides="Width"/>
                    <TextBlock Grid.Column="1" Grid.Row="0" Margin="5" TextWrapping="Wrap" Text="{Binding Name}"/>
                    <TextBlock Grid.Column="0" Grid.Row="1" Margin="5" TextWrapping="Wrap" Text="Size:" d:LayoutOverrides="Width"/>
                    <TextBlock Grid.Column="1" Grid.Row="1" Margin="5" TextWrapping="Wrap" Text="{Binding Length, Converter={StaticResource FileLengthBytesToTextConverter}}" d:LayoutOverrides="Width"/>
                    <TextBlock Grid.Column="0" Grid.Row="2" Margin="5" TextWrapping="Wrap" Text="Date Created:" d:LayoutOverrides="Width"/>
                    <TextBlock Grid.Column="1" Grid.Row="2" Margin="5" TextWrapping="Wrap" Text="{Binding DateCreated, Converter={StaticResource DateTimeOffsetToLocalDateTimeConverter}}" d:LayoutOverrides="Width"/>
                    <TextBlock Grid.Column="0" Grid.Row="3" Margin="5" TextWrapping="Wrap" Text="Date Modified:" d:LayoutOverrides="Width"/>
                    <TextBlock Grid.Column="1" Grid.Row="3" Margin="5" TextWrapping="Wrap" Text="{Binding DateModified, Converter={StaticResource DateTimeOffsetToLocalDateTimeConverter}}" d:LayoutOverrides="Width"/>
                    <TextBlock Grid.Column="0" Grid.Row="4" Margin="5" TextWrapping="Wrap" Text="Public:" d:LayoutOverrides="Width"/>
                    <TextBlock Grid.Column="1" Grid.Row="4" Margin="5" TextWrapping="Wrap" Text="{Binding IsPublicUriEnabled, Converter={StaticResource BooleanToYesNoConverter}}" d:LayoutOverrides="Width"/>
                </Grid>
            </controls:PivotItem>
        </controls:Pivot>

        <ProgressBar x:Name="ProgressBar" IsIndeterminate="{Binding IsBusy}" Height="10" VerticalAlignment="Top"/>
    </Grid>
</phone:PhoneApplicationPage>
